package com.maochang.top.service;

import com.maochang.top.bean.Account;
import com.maochang.top.config.SpringConfig;
import com.maochang.top.service.AccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        //ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
        //AccountService accountService = app.getBean("accountService", AccountService.class);
        //Account byId = accountService.findById(1);
        //System.out.println(byId);

        //SELECT top 6 * FROM news where nid not in (SELECT top 10 nid from news )
        ApplicationContext app=new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountService accountService = app.getBean("accountServiceImpl", AccountService.class);
        Account byId = accountService.findById(1);
        System.out.println(byId);
    }
}
